package com.example.easycharge.repository;

import com.example.easycharge.entity.Bill;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

public interface BillRepository extends JpaRepository<Bill, Long> {
    List<Bill> getBillsByCustomerId(long customerId);

    @Modifying
    @Transactional
    @Query(value = "delete from Bill")
    void initBill();
}
